Blockly.Blocks.file_read={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("读取文件")
            .setCheck("String");
        this.setOutput(true,"String");
    }
};

Blockly.Blocks.file_write={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("写入文件")
            .setCheck("String");
        this.appendValueInput("CONTENT",String)
            .appendField("内容")
            .setCheck("String");
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};

Blockly.Blocks.file_isfile={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("文件")
            .setCheck("String");
        this.appendDummyInput("")
            .appendField("是否存在？")
        this.setOutput(true,"Boolean");
        this.setInputsInline(true);
    }
};

Blockly.Blocks.file_remove={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("删除文件")
            .setCheck("String");
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};

Blockly.Blocks.file_listdir={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("遍历目录")
            .setCheck("String");
        this.appendDummyInput("")
            .appendField("下的所有文件并生成列表")
        this.setOutput(true,"Array");
        this.setInputsInline(true);
    }
};

Blockly.Blocks.file_mkdir={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("创建目录")
            .setCheck("String");
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};

Blockly.Blocks.file_isdir={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("目录")
            .setCheck("String");
        this.appendDummyInput("")
            .appendField("是否存在？")
        this.setOutput(true,"Boolean");
        this.setInputsInline(true);
    }
};

Blockly.Blocks.file_rmdir={
    init:function(){
        this.setColour(0);
        this.appendValueInput("PATH",String)
			.appendField("删除目录")
            .setCheck("String");
        this.setPreviousStatement(true);
        this.setNextStatement(true);
    }
};